package com.cnap.model.application;

import com.cnap.db.entity.ApplicationPO;
import com.cnap.model.file.FileInitReq;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Collections;

/**
 * <类文件描述>
 *
 * @author xc
 **/
class ApplicationDTOTest {

    @Test
    void testToPO() {
        ApplicationDTO applicationDTO = new ApplicationDTO();
        applicationDTO.setCategory(CategoryEnum.CATEGORY_AI.getValue());
        applicationDTO.setType(CategoryTypeEnum.AI_STATIC_TRAIN.getValue());
        applicationDTO.setApplicationName("appName");
        FileInitReq req = new FileInitReq();
        req.setTotalSize(1000);
        applicationDTO.setFileInitReq(req);
        applicationDTO.setVersion("1.0");
        applicationDTO.setUserName("admin");
        applicationDTO.setDescription("des");
        ApplicationLabel label = new ApplicationLabel();
        label.setObjectScene(Collections.singletonList("123"));
        label.setTechnology(Collections.singletonList("56"));
        applicationDTO.setLabel(label);

        ApplicationPO po = applicationDTO.toPO();

        Assertions.assertNotNull(po);
    }

}